package com.softwarerusher.model;

/**
 * TDiscountId entity.
 * 
 * @author MyEclipse Persistence Tools
 */

public class TDiscountId implements java.io.Serializable {

	// Fields

	private TBook TBook;
	private TShop TShop;

	// Constructors

	/** default constructor */
	public TDiscountId() {
	}

	/** full constructor */
	public TDiscountId(TBook TBook, TShop TShop) {
		this.TBook = TBook;
		this.TShop = TShop;
	}

	// Property accessors

	public TBook getTBook() {
		return this.TBook;
	}

	public void setTBook(TBook TBook) {
		this.TBook = TBook;
	}

	public TShop getTShop() {
		return this.TShop;
	}

	public void setTShop(TShop TShop) {
		this.TShop = TShop;
	}

	public boolean equals(Object other) {
		if ((this == other))
			return true;
		if ((other == null))
			return false;
		if (!(other instanceof TDiscountId))
			return false;
		TDiscountId castOther = (TDiscountId) other;

		return ((this.getTBook() == castOther.getTBook()) || (this.getTBook() != null
				&& castOther.getTBook() != null && this.getTBook().equals(
				castOther.getTBook())))
				&& ((this.getTShop() == castOther.getTShop()) || (this
						.getTShop() != null
						&& castOther.getTShop() != null && this.getTShop()
						.equals(castOther.getTShop())));
	}

	public int hashCode() {
		int result = 17;

		result = 37 * result
				+ (getTBook() == null ? 0 : this.getTBook().hashCode());
		result = 37 * result
				+ (getTShop() == null ? 0 : this.getTShop().hashCode());
		return result;
	}

}